package com.zqu.service.impl;

import com.zqu.mapper.PermissionMapper;
import com.zqu.pojo.Permission;
import com.zqu.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PermissionServiceImpl implements PermissionService {

    @Autowired(required = false)
    private PermissionMapper permissionMapper;

    @Override
    public Permission selectPermissionById(long id) {
        return permissionMapper.selectTById(id);
    }

    @Override
    public List<Permission> selectList(Permission permission) {
        return permissionMapper.selectList(permission);
    }

    @Override
    public boolean insertPermission(Permission permission) {
        return permissionMapper.insertT(permission)>0;
    }

    @Override
    public boolean updatePermission(Permission permission) {
        return permissionMapper.updateT(permission)>0;
    }

    @Override
    public boolean deletePermission(long id) {
        return permissionMapper.deleteT(id)>0;
    }

    @Override
    public boolean deletePermissionByIds(String[] ids) {
        return permissionMapper.deleteTByIds(ids)>0;
    }
}
